package hui.com.authority;

/**
 * 钥匙登录
 * 异常反馈
 */
public class AuthorityException extends RuntimeException{

    private final String errorMessage;
    public AuthorityException(String message) {
        super(message);
        this.errorMessage = message;
    }


    public String getErrorMessage() {
        return errorMessage;
    }
    /**
     * code:601,msg:前端钥匙为空
     * @return 前端钥匙为空
     */
    public static AuthorityException keyNULL() {
        return new AuthorityException("601");
    }

    /**
     * code:602,msg:过期令牌
     * @return 过期令牌
     */
    public static AuthorityException keyExpired() {
        return new AuthorityException("602");
    }

    /**
     * 权限不匹配
     * @return code:603,msg:无该权限
     */
    public static AuthorityException keyMismatch() {
        return new AuthorityException("603");
    }

    /**
     *  闲着无聊的人，才设置空权限注解
     * @return code:604,msg:闲着无聊的人，才设置空权限注解
     */
    public static AuthorityException keyERR() {
        return new AuthorityException("604");
    }
}
